package com.capgemini.scaffold.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.capgemini.scaffold.common.valid.AddGroup;
import com.capgemini.scaffold.common.valid.UpdateGroup;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.validator.constraints.NotBlank;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Null;

@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
@TableName("INTERN")
public class Intern {

    // 主键
    @TableId(type = IdType.AUTO)
    @NotNull(message = "修改必须指定id",groups = {UpdateGroup.class})
    @Null(message = "新增不能指定id",groups = {AddGroup.class})
    private Integer id;
    //实习生名字
    @NotBlank(message = "新增/修改学员姓名不能为空",groups = {AddGroup.class,UpdateGroup.class})
    @TableField("NAME")
    private String name;
    //实习生性别字典cold
    @TableField("SEX")
    private String sex;
    //实习生性别
    @NotBlank(message = "新增/修改学员性别不能为空",groups = {AddGroup.class,UpdateGroup.class})
    @TableField(exist = false)
    private String sexName;
    //实习生学校
    @NotBlank(message = "新增/修改学员学校不能为空",groups = {AddGroup.class,UpdateGroup.class})
    @TableField("SCHOOL")
    private String school;

    //实习生专业
    @NotBlank(message = "新增/修改学员专业不能为空",groups = {AddGroup.class,UpdateGroup.class})
    @TableField("MAJOR")
    private String major;

    //实习生状态
    @TableField("STATE")
    private String state;
    //实习生状态
    @NotBlank(message = "新增/修改学员姓名不能为空",groups = {AddGroup.class,UpdateGroup.class})
    @TableField(exist = false)
    private String stateName;

    //实习生所选职位
    @TableField("JOB")
    private String job;

    @NotBlank(message = "新增/修改学员所选职位不能为空",groups = {AddGroup.class,UpdateGroup.class})
    @TableField(exist = false)
    private String jobName;
    //实习生批次
    @NotBlank(message = "新增/修改学员批次不能为空",groups = {AddGroup.class,UpdateGroup.class})
    @TableField("BATCH")
    private String batch;
    //实习生电话
    @NotBlank(message = "新增/修改学员电话不能为空",groups = {AddGroup.class,UpdateGroup.class})
    @TableField("PHONE")
    private String phone;
    //导师id
    @TableField("TUTOR_ID")
    private Integer tutorId;


    //导师姓名
    @NotBlank(message = "新增/修改导师姓名不能为空",groups = {AddGroup.class,UpdateGroup.class})
    @TableField(exist = false)
    private String tutorName;


}
